package com.ruoyi.web.controller.asset;

import com.ruoyi.asset.domain.DisposalRecord;
import com.ruoyi.asset.domain.Employee;
import com.ruoyi.asset.service.EmployeeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author jiangxiangjin
 * @version V1.0.0
 * @description
 * @date 2023/4/10 15:38
 */
@Controller
@RequestMapping("/asset/employee")
public class EmployeeController extends BaseController {

    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/getEmployeeName")
    @ResponseBody
    public AjaxResult getEmployee(String userId) {

        Employee employee = employeeService.getEmployee(userId);

        return employee==null ? new AjaxResult(AjaxResult.Type.WARN,"不存在该用户"):new AjaxResult(AjaxResult.Type.SUCCESS,"操作成功",employee);
    }

}
